package com.btpj.module_search.adapter

import com.btpj.module_search.R
import com.btpj.module_search.data.entity.HotKeyModel
import com.btpj.module_search.databinding.ListItemHotKeyBinding
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.viewholder.BaseDataBindingHolder

class HotKeyListAdapter :
    BaseQuickAdapter<HotKeyModel, BaseDataBindingHolder<ListItemHotKeyBinding>>(layoutResId = R.layout.list_item_hot_key) {
    override fun convert(holder: BaseDataBindingHolder<ListItemHotKeyBinding>, item: HotKeyModel) {
        val binding = holder.dataBinding
        if (binding != null) {
            binding.hotKey = item
            binding.executePendingBindings()
        }
    }
}